UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oi5qQbmCdBlposykMu6I4yKYs7/bFzd+VhGXYI26EGI='
WHERE
key_id = '427e822f33b6c2fc09c1d03330f3a1d9d391da5fdb804ff0c52a957a4b21b4b7'
AND (
token = 'oi5qQbmCdBlposykMu6I4yKYs7/bFzd+VhGXYI26EGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)