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

Query time 0.00022