UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rc8ClrKIs67EJj8hdmneISvkxKFI3/3RaGI8dH16Y30='
WHERE
key_id = 'ef652eea4ee3ba113c56ffbcf09404e3e4dd7deb6c8a49a0fa38cc5606981a34'
AND (
token = 'Rc8ClrKIs67EJj8hdmneISvkxKFI3/3RaGI8dH16Y30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)