UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kiWku3dPbLzZfWtegb+OhEoo6eTg2IKmrIvOuUfLGRo='
WHERE
key_id = '335f8751c1b8a47b8ef7d61616eb9c08a38b6ba2ce42d4f562eb3f188f439e6b'
AND (
token = 'kiWku3dPbLzZfWtegb+OhEoo6eTg2IKmrIvOuUfLGRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)