UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pVkcxn7myMt+vaFrJ/Fq7ABAL8b3yrdlWtCmpqlJrcg=' 
WHERE 
  key_id = '5f471baa30970c2b927e929791e0130eb9ecd5141c5646cecb36316c027c7c2a' 
  AND (
    token = 'pVkcxn7myMt+vaFrJ/Fq7ABAL8b3yrdlWtCmpqlJrcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040