UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'daS2fgFy9tBkkF688MHQGZov+T6KcElkeoEPEp9oD/0=' 
WHERE 
  key_id = '744aa711c5c5ad8a689034c66bd2d6993388e5bb119b22b1a5ca2921a81e7c91' 
  AND (
    token = 'daS2fgFy9tBkkF688MHQGZov+T6KcElkeoEPEp9oD/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038