UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h3VU178hR4LjPOSDBUWYxBD1fNJAX/Vtn/XxMWlXblQ=' 
WHERE 
  key_id = '5d4f779b24a1b36d9fae453bcb92d6ac05481812697318a3c4c95faa16d8b18f' 
  AND (
    token = 'h3VU178hR4LjPOSDBUWYxBD1fNJAX/Vtn/XxMWlXblQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019