UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XrI/0EstnNK/iKW4T88Xg+dkH2prXW4uknCgCP7JMhc='
WHERE
key_id = 'a0c4eefb6dece33e70f57ecc47c1c707f9ce076f86e117c814254d61ee8c2711'
AND (
token = 'XrI/0EstnNK/iKW4T88Xg+dkH2prXW4uknCgCP7JMhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)