UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zYjSasaml9E1hgJTdW12ttKwtUDgvvwv7cpTo0VOslk=' 
WHERE 
  key_id = '3c2fd42fb86f4a7cbcbab817b427fc386ab9ed1d7499fc0a0edd749bf2990a9b' 
  AND (
    token = 'zYjSasaml9E1hgJTdW12ttKwtUDgvvwv7cpTo0VOslk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048