UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Isg2BLrUcIWD7Hfx/X16VJNc78TMy/z1i0xZYOsXm4k=' 
WHERE 
  key_id = 'aa34ba7d4d9dbcd6baea4070bdf37efdef6066649fe69ae8aed46f0939bb5503' 
  AND (
    token = 'Isg2BLrUcIWD7Hfx/X16VJNc78TMy/z1i0xZYOsXm4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021