UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kBJ8R5WcdZcK7Pel/6fKfk70dF0WgIl9cJU0fgMsbjA='
WHERE
key_id = '0c0d8e831b843258cd1f048b1d326b01a560b94fbe4c81d861833bfb67225112'
AND (
token = 'kBJ8R5WcdZcK7Pel/6fKfk70dF0WgIl9cJU0fgMsbjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)