UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vv5cC9l03/aLEUt3jlgglWIXL3AhmHLip7aalDGSgiQ=' 
WHERE 
  key_id = 'a21d09b4517ba7e8f56a7bf6696f9f83e925d83efdc8e2e304529b4de5c99209' 
  AND (
    token = 'Vv5cC9l03/aLEUt3jlgglWIXL3AhmHLip7aalDGSgiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038