UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xq2PL+fUpqARsnSizjz8t40Rbh5J11wEwQrNKzrIDFE=' 
WHERE 
  key_id = 'e99250e572d2db7ad4945c9d50c511fd35a4af2d743b58890f4a261a1c0b429e' 
  AND (
    token = 'xq2PL+fUpqARsnSizjz8t40Rbh5J11wEwQrNKzrIDFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023