UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1YXZ4a+gI+QugdQDAjgYwcD5kRY0AEIaVf/Q8qVvAZ8=' 
WHERE 
  key_id = '9a72a1e2045cbe5252693c3b4c6c2589394b85d9d7766daf2bdd760808ac4dac' 
  AND (
    token = '1YXZ4a+gI+QugdQDAjgYwcD5kRY0AEIaVf/Q8qVvAZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023