UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kNyKOqITaFvLYQsCGnX7qFJwcqj+OlRGLAbpxv0/N4o='
WHERE
key_id = '8a9b0f298cdc9d0a0cb293b95288207dd0abef9087ef57198220d6ba89ee2537'
AND (
token = 'kNyKOqITaFvLYQsCGnX7qFJwcqj+OlRGLAbpxv0/N4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)