UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hl1F8wrokoWcu9jH5PIQdWw+VLZIuVkilTS0CABXCc4='
WHERE
key_id = '27b835c303f421ee347b8295063b4bc26b525f9ad8a3dbbbec5956864516b3ba'
AND (
token = 'hl1F8wrokoWcu9jH5PIQdWw+VLZIuVkilTS0CABXCc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)