UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lKHGZZAJtEXrGtFuRN5RnTviSc2xofJPubFELT9QxFQ=' 
WHERE 
  key_id = 'fd544e11b3b89cbdaf688296492f859cef7ee279647d3d1d1417a6e07b644683' 
  AND (
    token = 'lKHGZZAJtEXrGtFuRN5RnTviSc2xofJPubFELT9QxFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025