UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NkFzgzbykhY4n5dTFTaC1Imx5YPjyFTvITQbkRWc0nY=' 
WHERE 
  key_id = '282bdc2a965c7a4836ea5697bff8bc1a1b7d5261af1b1f2281bf22d144181bd6' 
  AND (
    token = 'NkFzgzbykhY4n5dTFTaC1Imx5YPjyFTvITQbkRWc0nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040