UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zl9asscOBMhCBd594J8/Ar7nhNDGm3rJjQFoQGs6FpE='
WHERE
key_id = 'a6e85b4b0f41c3d94b2d7c3cdd6a8aafc88ed364b345ef0719deb8cf23d5e374'
AND (
token = 'Zl9asscOBMhCBd594J8/Ar7nhNDGm3rJjQFoQGs6FpE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)