UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JUG5xBHlUZdngPqKO+W86JpWEQmSsw7QqIAAmn8okgw=' 
WHERE 
  key_id = '6a2308d7bcbcaf55a970466e309ee77018abd054e70fd4e7d3a79c10d487e46c' 
  AND (
    token = 'JUG5xBHlUZdngPqKO+W86JpWEQmSsw7QqIAAmn8okgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020