UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rx2GZvb+WVGXkcpb7NkDvYGpzDeCIJCWnBMyXoh5mew='
WHERE
key_id = 'e14e6cc6ae62fe23f21344b2f8b4826accfacbbb358b8c8376733ae2e1bec212'
AND (
token = 'Rx2GZvb+WVGXkcpb7NkDvYGpzDeCIJCWnBMyXoh5mew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)