UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XuAVYZQjAhVLuNtNFrf7tzLtcj9byhXNdpD3Iho91Qo='
WHERE
key_id = 'bfe35a76a869152de8e529a2f10901d68fa74929926fc384f83de43178cc108e'
AND (
token = 'XuAVYZQjAhVLuNtNFrf7tzLtcj9byhXNdpD3Iho91Qo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)