UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '742/yqMHwqHcQdNAfajnxgwWMOQqEwD0b0AT4l0kDLA='
WHERE
key_id = 'f15f7a44fc57d7c1f6aeff83c1257ceb60c8fdaca5e34d63f490d6b4aae85f51'
AND (
token = '742/yqMHwqHcQdNAfajnxgwWMOQqEwD0b0AT4l0kDLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)