UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0T5ltNrXmqEjlkM8uFo2d3OEP6JZX3vapruOLJeIBLw=' 
WHERE 
  key_id = 'cd0db7d3b37cea3755ac148ee46a6e57e1bc0a4ce4eaefae97125613a5452569' 
  AND (
    token = '0T5ltNrXmqEjlkM8uFo2d3OEP6JZX3vapruOLJeIBLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038