UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBFiINi4p6FopugURNZ0WsmnpF7NamCqSl1dNsD2730=' 
WHERE 
  key_id = '62543bb7f7eb5a0009431774eb9b64b1737d8bf4fae96358c00d4d7daa0f0074' 
  AND (
    token = 'MBFiINi4p6FopugURNZ0WsmnpF7NamCqSl1dNsD2730=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018