UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CvgqxxlrVFZbCVfK6BgXZDGwWg/7iFSV8Xwx7SrtYgs='
WHERE
key_id = '07fa3094a593b7bb79fcacd0ee5e78ffe31ae879a2a643adf2e6d199b5d4c27d'
AND (
token = 'CvgqxxlrVFZbCVfK6BgXZDGwWg/7iFSV8Xwx7SrtYgs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)