UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lb9hamIBkfVdo+Z9/FA38rCKCbcT0t2m8ME5uWGOt64='
WHERE
key_id = 'd3a5eb611d21a0432e327d31a1a4de41ac3a782ec9330471ed0dcc4ad5ec6e5d'
AND (
token = 'Lb9hamIBkfVdo+Z9/FA38rCKCbcT0t2m8ME5uWGOt64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)