UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AxqdKRi8L+AAcAMRnAELeWchoL+EYmtYTspRUczaA7k=' 
WHERE 
  key_id = '84b93e108299c6fff05858ad7e482c92f720eb2c816f97d6b79ae157c6252707' 
  AND (
    token = 'AxqdKRi8L+AAcAMRnAELeWchoL+EYmtYTspRUczaA7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035