UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ttu5I0+eMPMOiUd4tfHTxak4IBvguQXJTQz8CbRneuA='
WHERE
key_id = 'bd4030f3e1915d1ee9ec5e4d4ca28399d5e5d7ff875a4f9eb7f6bbce61edc1c5'
AND (
token = 'Ttu5I0+eMPMOiUd4tfHTxak4IBvguQXJTQz8CbRneuA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)