UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GLKPP6eL8ikdTzgyhxunqEnuJzFmyZ5jpjXSPiWcwsU=' 
WHERE 
  key_id = 'bfb0bf04f2da8cd78da16af289df4ced392162b3686463f880edaafd8d635852' 
  AND (
    token = 'GLKPP6eL8ikdTzgyhxunqEnuJzFmyZ5jpjXSPiWcwsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026