UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RrgxNLiUaPR1RZC/iTf9ACSQm8CJvBvhq9sRJjTJ+NE=' 
WHERE 
  key_id = 'e87d2a0d6e61e6755049e61e7183918574c4bfc8b4a73f982cb1fc05fc035169' 
  AND (
    token = 'RrgxNLiUaPR1RZC/iTf9ACSQm8CJvBvhq9sRJjTJ+NE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016