UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dWM6cajvVKSR1tVCS2Yvm0QzQJ83q3Kz1kyNoYAD1MM='
WHERE
key_id = '2545b26e29f180cd35f3119fe876dd1356f65a0a6a9d375d1cf2b509c0b6a3d1'
AND (
token = 'dWM6cajvVKSR1tVCS2Yvm0QzQJ83q3Kz1kyNoYAD1MM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)