UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yrLKhFMWz6Qlnag951p3/Bl/3bbsCdsra8ENfAgoNGI='
WHERE
key_id = '3e4ad23e4f0aa0843bd5a927cdc0cb3511e5d539b12caa62ff300ed5e4d3db90'
AND (
token = 'yrLKhFMWz6Qlnag951p3/Bl/3bbsCdsra8ENfAgoNGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)