UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MyLXxf2t+IavDj7ukPExGDd9dK7m3Cn/tUA83u5CJSo=' 
WHERE 
  key_id = '039e3946cc1ecc0eb80504e28d8df9acc92844fb0b34dc17f974cc3d69629e23' 
  AND (
    token = 'MyLXxf2t+IavDj7ukPExGDd9dK7m3Cn/tUA83u5CJSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034